package com.aaa.day117.demo3;

/**
 * @Description:
 * @author:LiWei
 * @date:2022年11月07日13:27
 */
public class Singleton2 {

    private Singleton2(){


    }
    private static Singleton2 singleton2;

    public static Singleton2 getInstance(){
        synchronized (Singleton2.class){
            if(singleton2==null){
                singleton2=new Singleton2();
            }
            return singleton2;
        }
    }

    public void show(){
        System.out.println("=========show方法=========");
    }
}
